/**********************************************************************/
/**  Copyright (c) ECC labs. 2001-2002. All Rights Reserved.		 **/
/**********************************************************************/
/*
	binword.h
	Mark Papazyan

*/

#ifndef __CBinLongWord_H
#define __CBinLongWord_H

#include <iostream>
#include <string>
#include "binword.h"

using namespace std;

#define DOS32

#ifdef DOS16
	#define MOD 32
#endif

#ifdef DOS32
	#define MOD 64
#endif /*DOS32*/



class CBinLongWord
{
public:

//Variables

	t_src* num;
	t_len weight;
	t_len n;
	t_len len;

//Constructor/Destructor

 	CBinLongWord(t_len k=0);
 	CBinLongWord(char* ch, t_len k=MAX_LENGTH);
	CBinLongWord(const CBinLongWord&);
	~CBinLongWord();

	CBinLongWord& operator =(const CBinLongWord&t);

//Manipulations

	t_src* bin_to_dec(char*);
	t_src* bin_to_dec(string&);
	char* dec_to_bin();

	t_len wt();
	void next();
	void cyclic_shift(t_len, char where='r');
	void shift(t_len, char where='r');

	void bit_set(t_len);
	void bit_clear(t_len);
	void bit_swap(t_len, t_len);
	t_res is_set(t_len);

//Operations

	CBinLongWord& operator+=(CBinLongWord&);
	CBinLongWord operator+(CBinLongWord&);
	CBinLongWord& operator^=(CBinLongWord&);
	CBinLongWord operator^(CBinLongWord&);
	operator char*(){return dec_to_bin();}

};

//Input/Ouput

ostream& operator<<(ostream&, CBinLongWord&);
istream& operator>>(istream&, CBinLongWord&);

t_len d(CBinLongWord, CBinLongWord);

#endif
